<html>
<head><meta charset="utf-8"><title>Interner · z-archived-t-compiler/wg-rls-2.0/chalk · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/index.html">z-archived-t-compiler/wg-rls-2.0/chalk</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html">Interner</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="189540540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189540540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189540540">(Mar 02 2020 at 21:45)</a>:</h4>
<p>See <a href="https://github.com/rust-lang/chalk/pull/342" target="_blank" title="https://github.com/rust-lang/chalk/pull/342">https://github.com/rust-lang/chalk/pull/342</a>. Do we need to thread our <code>Interner</code> through <code>to_chalk</code>? It's required for the <code>intern</code> calls <a href="https://github.com/rust-analyzer/rust-analyzer/blob/807a56bebfecf6f655c48c3490c296180045c44b/crates/ra_hir_ty/src/traits/chalk.rs#L143-L181" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/807a56bebfecf6f655c48c3490c296180045c44b/crates/ra_hir_ty/src/traits/chalk.rs#L143-L181">here</a>. <span class="user-mention" data-user-id="129457">@Florian Diebold</span></p>



<a name="189540857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189540857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189540857">(Mar 02 2020 at 21:48)</a>:</h4>
<p>I think our <code>Interner</code> will at most contain the <code>db</code> and crate ID (maybe not even that), so... not necessarily</p>



<a name="189540911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189540911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189540911">(Mar 02 2020 at 21:49)</a>:</h4>
<p>for just upgrading, I'm pretty sure we can just construct <code>Interner {}</code>s out of thin air</p>



<a name="189541049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189541049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189541049">(Mar 02 2020 at 21:50)</a>:</h4>
<p>when we add the db to the <code>Interner</code>, we can then replace the <code>db</code> parameter in <code>to_chalk</code> by the <code>Interner</code></p>



<a name="189541091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189541091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189541091">(Mar 02 2020 at 21:50)</a>:</h4>
<p>Ah, good point, it's a no-op anyway</p>



<a name="189541156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189541156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189541156">(Mar 02 2020 at 21:51)</a>:</h4>
<p>probably makes sense to make <code>Interner</code> a unit struct for now</p>



<a name="189541311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189541311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189541311">(Mar 02 2020 at 21:52)</a>:</h4>
<p>The <code>impl chalk_solve::RustIrDatabase&lt;Interner&gt; for ChalkContext&lt;'a, DB&gt;</code> also needs to return an <code>&amp;Interner</code>, can I just add one to <code>ChalkContext</code>? I mean I can, but..</p>



<a name="189541550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189541550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189541550">(Mar 02 2020 at 21:55)</a>:</h4>
<p>well, if you make it a unit struct, you can just return <code>&amp;Interner</code> for now</p>



<a name="189541771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189541771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189541771">(Mar 02 2020 at 21:57)</a>:</h4>
<p>Oh, I didn't think that could work, thanks.</p>



<a name="189541944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189541944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189541944">(Mar 02 2020 at 21:58)</a>:</h4>
<p>maybe we'll just make <code>ChalkContext</code> the interner <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> I'll have to see what we actually need the interner to have</p>



<a name="189617305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189617305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189617305">(Mar 03 2020 at 17:57)</a>:</h4>
<p>I looked into adding the db to <code>Interner</code>, and it's quite a large change because it needs to be generic over the database and its lifetime</p>



<a name="189617340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189617340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189617340">(Mar 03 2020 at 17:58)</a>:</h4>
<p>I can try adding them, but I'm not sure it's the right approach. Then there's also <code>ToChalk::Chalk</code>, which looks like it might need GAT</p>



<a name="189624078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189624078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189624078">(Mar 03 2020 at 19:12)</a>:</h4>
<p>I would only do it if/when we actually need to do it to implement something</p>



<a name="189624115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189624115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189624115">(Mar 03 2020 at 19:13)</a>:</h4>
<p>also, I think there are currently required bounds on the interner that will prevent it</p>



<a name="189624817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner/near/189624817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/191167-z-archived-t-compiler/wg-rls-2.0/chalk/topic/Interner.html#189624817">(Mar 03 2020 at 19:20)</a>:</h4>
<p>Maybe we can pass around both the db and the interner, then</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>